package cn.cloudtogo.support.mysql;

import lombok.Data;

/**
 * @author yaolianhua789@gmail.com
 **/
@Data
public class Condition {

    private String fields;

    private Integer page;

    private Integer size;

    private String where;

    public static Condition of(String fields, Integer page, Integer size, String where) {
        Condition condition = new Condition();
        condition.setFields(fields);
        condition.setPage(page == null ? 1 : page);
        condition.setSize(size == null ? 100 : size);
        condition.setWhere(where);

        return condition;
    }
}
